com.supermap.realspace
Class FlyManager
- java.lang.Object
-
- com.supermap.realspace.FlyManager
-
public class FlyManager extends java.lang.Object
3D scene flight management class.
-
-
Constructor Summary
Constructors Constructor and Description FlyManager()
The default constructor, which constructs a new FlyManager object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addStatusChangedListener(StatusChangedListener l)
Add a listener for receiving flight status change events (StatusChangedListener
).void
addStopArrivedListener(StopArrivedListener l)
Add a listener for receiving flight arrival events (StopArrivedListener
).void
dispose()
Release the resources occupied by the object.int
getCurrentStopIndex()
Return to the current stop of the flight.double
getDuration()
Returns the total time required for this flight (that is, the current entire route), in seconds.double
getProgress()
Returns the current progress of this flight, in seconds.Routes
getRoutes()
Return to the route collection.Scene
getScene()
Returns the associated scene.FlyStatus
getStatus()
Return to the current flight status (stopped, paused, in flight).void
pause()
Pause the current flight and fly from the current stop next time.void
play()
Start the flight according to the route specified by the returned route collection (Routes
), or continue the interrupted flight.void
removeStatusChangedListener(StatusChangedListener l)
Remove a listener for receiving flight status change events (StatusChangedListener
).void
removeStopArrivedListener(StopArrivedListener l)
Remove a listener for receiving flight arrival events (StopArrivedListener
).void
setScene(Scene scene)
Set the associated scene.void
stop()
Stop the current flight and fly from the beginning of the route next time.void
update()
Update the flight site and flight route.
-
-
-
Constructor Detail
-
FlyManager
public FlyManager()
The default constructor, which constructs a new FlyManager object.
-
-
Method Detail
-
dispose
public void dispose()
Release the resources occupied by the object.
-
getRoutes
public Routes getRoutes()
Return to the route collection.- Returns:
- Route collection.
-
getScene
public Scene getScene()
Returns the associated scene.- Returns:
- The associated scene.
-
setScene
public void setScene(Scene scene)
Set the associated scene.- Parameters:
scene
- The associated scene.
-
play
public void play()
Start the flight according to the route specified by the returned route collection (Routes
), or continue the interrupted flight.- Example:
- The following code demonstrates how to continue flying along the specified route, assuming that the 3D scene is in a state of suspended flight.
-
stop
public void stop()
Stop the current flight and fly from the beginning of the route next time.
-
pause
public void pause()
Pause the current flight and fly from the current stop next time.
-
getDuration
public double getDuration()
Returns the total time required for this flight (that is, the current entire route), in seconds.- Returns:
- The total time required for this flight (ie the current entire route). The unit is seconds.
-
getProgress
public double getProgress()
Returns the current progress of this flight, in seconds.Note: This attribute is only available in flight and paused states, and not available when stopped
- Returns:
- The current progress of this flight. The unit is seconds.
-
getCurrentStopIndex
public int getCurrentStopIndex()
Return to the current stop of the flight.Note: This attribute is only available in flight and paused states, and not available when stopped
- Returns:
- The site you are currently flying to.
-
getStatus
public FlyStatus getStatus()
Return to the current flight status (stopped, paused, in flight).- Returns:
- current flight status
-
addStatusChangedListener
public void addStatusChangedListener(StatusChangedListener l)
Add a listener for receiving flight status change events (StatusChangedListener
).For the constant types of flight status, please refer to the
FlyStatus
class.- Parameters:
l
- A listener for the user to receive flight status changes.
-
removeStatusChangedListener
public void removeStatusChangedListener(StatusChangedListener l)
Remove a listener for receiving flight status change events (StatusChangedListener
).For the constant types of flight status, please refer to the
FlyStatus
class.- Parameters:
l
- A listener for the user to receive flight status changes.
-
addStopArrivedListener
public void addStopArrivedListener(StopArrivedListener l)
Add a listener for receiving flight arrival events (StopArrivedListener
).- Parameters:
l
- A listener for receiving flight arrival events.
-
removeStopArrivedListener
public void removeStopArrivedListener(StopArrivedListener l)
Remove a listener for receiving flight arrival events (StopArrivedListener
).- Parameters:
l
- A listener for receiving flight arrival events.
-
update
public void update()
Update the flight site and flight route.
-
-